package com.unifiedlibrary.amall_page.module.category;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.unifiedlibrary.amall_page.R;

/**
 * 分类列表fragment
 */
public class CategoryListFragment extends Fragment {

    private RecyclerView recContentList;

    public CategoryListFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View containtView = inflater.inflate(R.layout.fragment_category_list, container, false);

        recContentList = containtView.findViewById(R.id.recy_content_list);
        initData();
        return containtView;
    }

    private void initData() {
        final GridLayoutManager gridManager = new GridLayoutManager(getContext(),3);
        gridManager.setSpanSizeLookup(new androidx.recyclerview.widget.GridLayoutManager.SpanSizeLookup() {
            public int getSpanSize(int position) {
                return 1;
            }
        });
    }
}
